<%@ page pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='zbjsh'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>
<div class="layui-container">
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend><fmt:message key='zbjxx'/></legend>
        </fieldset>


        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='zbjmc'/></label>
            <div class="layui-form-mid layui-word-aux">${liveCheck.name}</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='zbjms'/></label>
            <div class="layui-form-mid layui-word-aux">${liveCheck.introduce}
            </div>
        </div>


        <div class="layui-form-item goodsChannelArea">
            <label class="layui-form-label"><fmt:message key='sqsj'/></label>
            <div class="layui-form-mid layui-word-aux"><fmt:formatDate value="${liveCheck.createTime}" type="both"/></div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='shzt'/></label>
            <div class="layui-form-mid layui-word-aux">
                <c:if test="${liveCheck.checkStatus == 1}"><fmt:message key='shz'/></c:if>
                <c:if test="${liveCheck.checkStatus == 2}"><fmt:message key='shtg'/></c:if>
                <c:if test="${liveCheck.checkStatus == 3}"><fmt:message key='shbtg'/></c:if>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='zbtp'/></label>
            <div class="layui-form-mid layui-word-aux">
                <img src="${store_domain}/uploads/${liveCheck.image}" class="perview" style="max-height: 240px;">
            </div>
        </div>

        <c:if test="${liveCheck.checkStatus > 1}">
            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='shbz'/></label>
                <div class="layui-form-mid layui-word-aux">${liveCheck.checkNote}</div>
            </div>
        </c:if>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend><fmt:message key='fzrxx'/></legend>
        </fieldset>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='fzrmc'/></label>
            <div class="layui-form-mid layui-word-aux">${liveCheck.user.realName}</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='fzrsjh'/></label>
            <div class="layui-form-mid layui-word-aux">${liveCheck.user.mobile}</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='sfzhm'/></label>
            <div class="layui-form-mid layui-word-aux">${liveCheck.idCardNo}</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='sfzzm'/></label>
            <div class="layui-form-mid layui-word-aux">
                <img src="${store_domain}/uploads/${liveCheck.idCardFront}" class="perview" style="max-height: 240px">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='sfzfm'/></label>
            <div class="layui-form-mid layui-word-aux">
                <img src="${store_domain}/uploads/${liveCheck.idCardReverse}" class="perview" style="max-height: 240px">
            </div>
        </div>


        <c:if test="${liveCheck.checkStatus == 1}">

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='shcz'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <input type="radio" name="checkStatus" title="<fmt:message key='shtg'/>" value="2" checked>
                    <input type="radio" name="checkStatus" title="<fmt:message key='shbtg'/>" value="3">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='shbz'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <textarea name="checkNote" rows="5" class="layui-textarea"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"></label>
                <div class="layui-form-mid layui-word-aux">
                        <input type="button" value="<fmt:message key='qrsh'/>" class="check-btn layui-btn" data-id="${liveCheck.id}">
                </div>
            </div>
        </c:if>
    </div>
</div>

<script>

    layui.use(["layer", "form"], function () {
        $(".check-btn").click(function () {
            var id = $(this).attr("data-id");
            var checkStatus = $("[name='checkStatus']:checked").val();
            var checkNote = $("[name='checkNote']").val();
            feijin.put({
                url: "${web_domain}/live/check",
                data: {"id": id, "checkStatus": checkStatus, "checkNote": checkNote},
                success: function (res) {
                    if (res.status) {
                        parent.location.reload();
                    } else {
                        layer.alert(res.message);
                    }
                }
            })
        });
    });
</script>
</body>
</fmt:bundle>
</html>